package com.lufei.dh.view;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.Button;

import com.amap.api.maps.model.LatLng;
import com.amap.api.maps.model.Poi;

import com.amap.api.navi.AmapNaviPage;
import com.amap.api.navi.AmapNaviParams;
import com.amap.api.navi.AmapNaviType;
import com.amap.api.navi.AmapRouteActivity;
import com.amap.api.navi.INaviInfoCallback;
import com.amap.api.navi.model.AMapNaviLocation;
import com.lufei.dh.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2018/3/20 0020.
 */

public class HDMain extends Activity {
    @BindView(R.id.id_dh_btn1)
    Button idDhBtn1;
    @BindView(R.id.id_dh_btn2)
    Button idDhBtn2;
    INaviInfoCallback iNaviInfoCallback;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.hdmain_activity);
        ButterKnife.bind(this);
//        xc();
    }

    @OnClick({R.id.id_dh_btn1, R.id.id_dh_btn2})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.id_dh_btn1:
                AmapNaviPage.getInstance().showRouteActivity(this, new AmapNaviParams(null), iNaviInfoCallback);
                break;
            case R.id.id_dh_btn2:
                Poi start = new Poi("三元桥", new LatLng(39.96087, 116.45798), "");
/**终点传入的是北京站坐标,但是POI的ID "B000A83M61"对应的是北京西站，所以实际算路以北京西站作为终点**/
                Poi end = new Poi("北京站", new LatLng(39.904556, 116.427231), "B000A83M61");
                AmapNaviPage.getInstance().showRouteActivity(this, new AmapNaviParams(start, null, end, AmapNaviType.DRIVER), iNaviInfoCallback);
                break;
        }
    }

//    private void xc() {
//        iNaviInfoCallback = new INaviInfoCallback() {
//            @Override
//            public void onInitNaviFailure() {
//
//            }
//
//            @Override
//            public void onGetNavigationText(String s) {
//
//            }
//
//            @Override
//            public void onLocationChange(AMapNaviLocation aMapNaviLocation) {
//
//            }
//
//            @Override
//            public void onArriveDestination(boolean b) {
//
//            }
//
//            @Override
//            public void onStartNavi(int i) {
//
//            }
//
//            @Override
//            public void onCalculateRouteSuccess(int[] ints) {
//
//            }
//
//            @Override
//            public void onCalculateRouteFailure(int i) {
//
//            }
//
//            @Override
//            public void onStopSpeaking() {
//
//            }
//
//            @Override
//            public void onReCalculateRoute(int i) {
//
//            }
//
//            @Override
//            public void onExitPage(int i) {
//
//            }
//        };
//    }
}
